package com.search.service.serviceImp;

import com.search.entity.Snacks;
import com.search.mapper.SnacksMapper;
import com.search.response.SearchResponse;
import com.search.service.SnacksService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class SnacksServiceImp implements SnacksService {
    @Autowired
    private SnacksMapper snacksMapper;

    @Override
    public List<Snacks> getSnacksByNameOrIntroduction(String query) {
        List<Snacks> result = snacksMapper.getSnacksByNameOrIntroduction(query);
        return result;
    }

    @Override
    public List<Snacks> getAllSnacks() {
        List<Snacks> result = snacksMapper.getAllSnacks();
        log.info("getAllSnacks的result={}", result);
        return result;
    }
}
